import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  { path: '/login', component: () => import('@/views/login') },
  {
    path: '/', component: () => import('@/views/layout'),
    redirect: '/home',
    children: [
      {
        path: 'home',
        component : ()=> import('@/views/home')
      },
      {
        path: 'my',
        component: () => import('@/views/my')
      },
      {
        path: 'qa',
        component: () => import('@/views/qa')
      },
    ]
  },
  {
    path: '/article/:id',
    component: () => import('@/views/article'),
    props: true
  }
      
]

const router = new VueRouter({
  routes
})

export default router
